$(function() {
	

	
	
	
	var swiper = new Swiper('.swiper-container', {
		direction: 'vertical',
		followFinger: false,
		speed: 800,
		mousewheelControl: true,
		pagination: '.swiper-pagination',
		paginationClickable: true,
		onInit: function(swiper) {
			slide = swiper.slides.eq(0);
			slide.addClass('ani-slide');
		},
		onTransitionStart: function(swiper) {
			for(i = 0; i < swiper.slides.length; i++) {
				slide = swiper.slides.eq(i);
				slide.removeClass('ani-slide');
			}
		},
		onTransitionEnd: function(swiper) {
			slide = swiper.slides.eq(swiper.activeIndex);
			slide.addClass('ani-slide');
		},

	});
	
	var $master = $("#master"),
		$tc = $master.find(".tc"),
		$ul = $tc.find(".inner")
		$list = $tc.find(".list"),
		$listWidth =$tc.width();
	
	$ul.css("width",$listWidth * $list.length +1)
	
	
	$("#master .m-btn").on('click',function(){
		jump(1)
	})
	
	
	$("#master .pre").on("click",function(){
		jump(0)
	})
	
	$("#master .next").on("click",function(){
		jump(2)
	})
	
	
	
	
	/*dot*/
	
	var $dot = $("#master .dot li")
	
	$dot.on("click",function(){
		
		
		var $index = $(this).index();
		jump($index)
		
		
	})
	function jump (num){
		$ul.css({
			"transition":"all 0.4s",
			"transform":'translateX('+ -$listWidth * num +'px)'
			
		})
	}
	
	/*--close--*/
	var $close = $("#master .close");

	
	$close.on('click',function(){
		$master.hide()
	})
	$("#p4Btn").on('click',function(){
		$master.show()
	})
	
	
	
	
})